WOL stands for Wake On Lan, and it’s a feature that allows you to turn on a computer remotely by sending a magic packet to its network interface
sudo apt install netcat
wol.sh
#!/bin/bash
# MAC address of the target machine
MAC=$1
# Convert MAC address into hex
HEX_MAC=$(echo $MAC | sed 's/://g')
# Create the magic packet
MAGIC_PACKET=$(printf 'f%.0s' {1..12}; printf "${HEX_MAC}%.0s" {1..16})
# Send the magic packet using netcat
echo -e $MAGIC_PACKET | xxd -r -p | nc -w1 -ub 255.255.255.255 $2
./wol.sh <MAC address> <port>
Usually the port is 9 or 7
sudo nc -luk <port> | xxd